package com.example.designpattern.creator.abstractfactory;

public class CarFactory {

	public static Car buildCar(CarType model, Location location) {
		Car car = null;
		switch (location) {
		case USA:
			car = USACarFactory.buildCar(model);
			break;
		case ASIA:
			car = ASIACarFactory.buildCar(model);
			break;
		default:
			car = DefaultCarFactory.buildCar(model);
		}
		return car;
	}
	
	public static void main(String[] args) {
		System.out.println(buildCar(CarType.LUXURY, Location.USA));
		System.out.println(buildCar(CarType.SEDAN, Location.USA));
		System.out.println(buildCar(CarType.SMALL, Location.USA));
	}
}
